<script setup lang="ts">

</script>

<template>
  <div class="wrap">
    <div class="container parent">
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item subgrid">
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
      </div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
      <div class="item"></div>
    </div>
  </div>
</template>

<style scoped lang="scss">
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.wrap {
  width: 100vw;
  min-height: 100vh;
  font-family: "Exo", "Bungee Shade", cursive, Arial, sans-serif;
  background-color: #557;
  color: #fff;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100% - 2rem, 400px), 1fr));
  place-content: center;
  padding: 1rem;
  gap: 1rem;

  .container {
    outline: 3px dashed #111;
    padding: 10px;
    counter-reset: item;
    background: #333;

    & > .item::before {
      content: counter(item);
      font-family: "Bungee Shade", cursive;
      font-size: 3.5rem;
    }

    .item {
      counter-increment: item;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: #2c6;
      color: #000;
      position: relative;

      &:nth-child(1) {
        background-color: #f196f3;
      }

      &:nth-child(2) {
        background-color: #dac2f1;
      }

      &:nth-child(3) {
        background-color: #ccf1c2;
      }

      &:nth-child(4) {
        background-color: #c2e9f1;
      }

      &:nth-child(5) {
        background-color: #90aeef;
      }

      &:nth-child(6) {
        background-color: #f44336;
      }

      &:nth-child(7) {
        background-color: #2196f3;
      }

      &:nth-child(8) {
        background-color: #f196f3;
      }

      &::before {
        content: counter(item);
        font-family: "Bungee Shade", cursive;
        font-size: 3.5rem;
      }
    }

    &.parent {
      display: grid;
      grid-template-columns: repeat(3, 1fr 2fr);
      grid-template-rows: auto auto auto;
      gap: 1rem;
    }

    .subgrid {
      grid-column: 2 / 6;
      grid-row: 1 / 3;

      display: inherit;
      grid-template-columns: subgrid;
      grid-template-rows: repeat(2, 100px 1fr);
      & > .item::before {
        content: "5-" counter(item);
        font-family: "Bungee Shade", cursive;
        font-size: 2rem;
      }
    }

  }
}
</style>
